﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="EditUser.aspx.cs" Inherits="cognysClient.Admin.WebForm3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="divMain" class="divMain" runat="server">

       <div id="divSearchUser" class="divSearchUser" runat="server">

            <h2 class="titlePage">Redigera Användare</h2>
            <p class="pSearch" >Sök användare:</p>
            <asp:Label ID="lblSearchPersonal" runat="server" cssClass="lblSearchUser" Text="Personnummer:"></asp:Label>
            <asp:TextBox ID="tbSearchPersonal" runat="server" CssClass="tbxSearchUser" ></asp:TextBox>
            <asp:Label ID="lblSearchFirstName" runat="server" cssClass="lblSearchUser" Text="Förnamn:"></asp:Label>
            <asp:TextBox ID="tbSearchFirstName" runat="server" CssClass="tbxSearchUser"></asp:TextBox>
            <asp:Label ID="lblSearchLastName" runat="server" cssClass="lblSearchUser" Text="Efternamn:"></asp:Label>
            <asp:TextBox ID="tbSearchLastName" runat="server" CssClass="tbxSearchUser"></asp:TextBox>
            <asp:Button ID="btnSearchUser" runat="server" CssClass="btnSearchUser" Text="Sök Användare" OnClick="btnSearchUser_Click" ValidationGroup="searchUser" />
          <br/><br/><br/>
            <asp:ValidationSummary ID="ValidationSummary1" runat="server"  
                         ValidationGroup="searchUser"/>
        </div>

        <div id="divListBoxSearchUser" class="divListBoxSearchUser" runat="server">
            <p class="pPersons" >Personer:</p>
            <asp:ListBox ID="lbxSearchUser" CssClass="lbxSearchUser" runat="server" OnSelectedIndexChanged="lbxSearchUser_SelectedIndexChanged" AutoPostBack="true"></asp:ListBox>
        </div>

        <div id="divEditUser" class="divEditUser" runat="server">
            <p class="pEdit" >Redigera:</p>
            <asp:Label ID="lblFirstNameEditUser" runat="server" CssClass="lblEditUser" Text="Förnamn:"></asp:Label><br />          
            <asp:TextBox ID="tbFirstNameEditUser" runat="server" CssClass="tbxEditUser"></asp:TextBox><br />
            <asp:Label ID="lblLastNameEditUser" runat="server" CssClass="lblEditUser" Text="Efternamn:"></asp:Label><br />
            <asp:TextBox ID="tbLastNameEditUser" runat="server" CssClass="tbxEditUser"></asp:TextBox><br />
            <asp:Label ID="lblPersonalEditUser" runat="server" CssClass="lblEditUser" Text="Personnummer:"></asp:Label><br />
            <asp:TextBox ID="tbPersonalEditUser" runat="server" CssClass="tbxEditUser"></asp:TextBox><br />
            <asp:Label ID="lblUserNameEditUser" runat="server" CssClass="lblEditUser" Text="Användarnamn:"></asp:Label><br />
            <asp:TextBox ID="tbUserNameEditUser" runat="server" CssClass="tbxEditUser" Enabled="False"></asp:TextBox><br />
            <asp:Label ID="lblPasswordEditUser" runat="server" CssClass="lblEditUser" Text="Lösenord:"></asp:Label>
            <asp:Label ID="lblChangePasswordEditUser" runat="server" CssClass="lblEditPassword" Text="Nytt Lösenord:"></asp:Label>
            <asp:TextBox ID="tbPasswordEditUser" runat="server" CssClass="tbxEditUser" Enabled="False"></asp:TextBox>
            <asp:TextBox ID="tbChangePasswordEditUser" runat="server" CssClass="tbxEditPassword" Text="" ></asp:TextBox>
            <br />
            <asp:Button ID="btnEditUser" runat="server" CssClass="btnEditUser" Text="Redigera Användare" OnClick="btnEditUser_Click" ValidationGroup="editUser"/>
            
            <br/><br/><br/>
            <asp:ValidationSummary ID="editUserValidationSummary" runat="server"  
                         ValidationGroup="editUser"/>
        </div>

    </div>
    
    <asp:RegularExpressionValidator id="RegularExpressionValidator2" runat="server" 
        ErrorMessage="Felaktigt förnamn" 
        ValidationExpression="^([\S\s]{0,25})$" 
        ControlToValidate="tbFirstNameEditUser" 
        ValidationGroup="editUser"/>
    
    <asp:RegularExpressionValidator id="RegularExpressionValidator5" runat="server" 
        ErrorMessage="Felaktigt förnamn" 
        ValidationExpression="^([\S\s]{0,25})$" 
        ControlToValidate="tbSearchFirstName" 
        ValidationGroup="searchUser"/>
    
    <asp:RegularExpressionValidator id="RegularExpressionValidator7" runat="server" 
        ErrorMessage="Felaktigt personnummer" 
        ValidationExpression="^([0-9]{0,10})$" 
        ControlToValidate="tbSearchPersonal" 
        ValidationGroup="searchUser"/>

    <asp:RegularExpressionValidator id="RegularExpressionValidator6" runat="server" 
        ErrorMessage="Felaktigt efternamn" 
        ValidationExpression="^([\S\s]{2,25})$" 
        ControlToValidate="tbSearchLastName" 
        ValidationGroup="searchUser"/>
    
    <asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server" 
        ErrorMessage="Felaktigt efternamn" 
        ValidationExpression="^([\S\s]{2,25})$" 
        ControlToValidate="tbLastNameEditUser" 
        ValidationGroup="editUser"/>
    
    <asp:RegularExpressionValidator id="RegularExpressionValidator4" runat="server" 
        ErrorMessage="Lösenordet måste vara mellan 5-25 tecken" 
        ValidationExpression="^([\S\s]{5,25})$" 
        ControlToValidate="tbChangePasswordEditUser" 
        ValidationGroup="editUser"/>
    
    <asp:RegularExpressionValidator id="RegularExpressionValidator3" runat="server" 
        ErrorMessage="Felaktigt personnummer" 
        ValidationExpression="^([0-9]{10,10})$" 
        ControlToValidate="tbPersonalEditUser" 
        ValidationGroup="editUser"/>
    
    <asp:RequiredFieldValidator   
        ID="RequiredFieldValidator1"  
        runat="server"  
        ControlToValidate="tbFirstNameEditUser"  
        Text="*"
        ErrorMessage="Förnamn saknas" 
        ValidationGroup="editUser"  />  
    
     <asp:RequiredFieldValidator   
        ID="RequiredFieldValidator2"  
        runat="server"  
        ControlToValidate="tbLastNameEditUser"  
        Text="*" 
         ErrorMessage="Efternamn saknas" 
         ValidationGroup="editUser" />  
    
     <asp:RequiredFieldValidator   
        ID="RequiredFieldValidator3"  
        runat="server"  
        ControlToValidate="tbPersonalEditUser"  
        Text="*" 
         ErrorMessage="Personnummer saknas" 
         ValidationGroup="editUser" />  
    <asp:RequiredFieldValidator   
        ID="RequiredFieldValidator4"  
        runat="server"  
        ControlToValidate="tbChangePasswordEditUser"  
        Text="*" 
         ErrorMessage="Lösenord saknas" 
         ValidationGroup="editUser" />  

</asp:Content>
